package com.trw.trp.bean;

import java.util.ArrayList;
import java.util.List;

public class ModelBean implements Cloneable {

	private long modelId;
	private String modelName;
	private String clientUniqueId;
	private int status;
	private List<ModelBean> subModelList;

	public String getClientUniqueId() {
		return clientUniqueId;
	}

	public void setClientUniqueId(String clientUniqueId) {
		this.clientUniqueId = clientUniqueId;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public long getModelId() {
		return modelId;
	}

	public void setModelId(long modelId) {
		this.modelId = modelId;
	}

	public String getModelName() {
		return modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	public List<ModelBean> getSubModelList() {
		return subModelList;
	}

	public void setSubModelList(List<ModelBean> subModelList) {
		this.subModelList = subModelList;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null || !(o instanceof ModelBean)) {
			return false;
		}
		return ((ModelBean) o).modelId == modelId;
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		ModelBean model = (ModelBean) super.clone();
		if (subModelList != null) {
			List<ModelBean> sMList = new ArrayList<ModelBean>();
			for (ModelBean bean : subModelList) {
				sMList.add((ModelBean) bean.clone());
			}
			model.setSubModelList(sMList);
		}
		return model;
	}

	@Override
	public String toString() {
		return "ModelBean [modelId=" + modelId + ", modelName=" + modelName
				+ ", clientUniqueId=" + clientUniqueId + ", status=" + status
				+ ", subModelList=" + subModelList + "]";
	}

}
